package tr.edu.metu.is.mega.server.business;

import java.util.List;

import tr.edu.metu.is.mega.common.dto.UserCoursesViewDTO;
import tr.edu.metu.is.mega.server.dao.UserCoursesViewDAO;
import tr.edu.metu.is.mega.server.entity.Usercoursesview;

/**
 * Class to manage schedule templates.
 */
public class UserCoursesViewManager {

    private final UserCoursesViewDAO dao;

    private final UserCoursesViewDTOHelper helper;

    /**
     * Default constructor.
     */
    public UserCoursesViewManager() {
        dao = new UserCoursesViewDAO();
        helper = new UserCoursesViewDTOHelper();
    }

    public List<UserCoursesViewDTO> findByExample(UserCoursesViewDTO example) {
        Usercoursesview usercoursesview = new Usercoursesview();
        helper.convertToEntity(example, usercoursesview);
        return helper.toDTO(dao.findByExample(usercoursesview, false));
    }

}
